<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8">
	<title>Camera Example</title>
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<style>
	body{
		background: black;
	}
	</style>
	<script type="text/javascript">
// 扩展API加载完毕后调用onPlusReady回调函数 
document.addEventListener( "plusready", onPlusReady, false );
// 扩展API加载完毕，现在可以正常调用扩展API 
function onPlusReady() {
	console.log("plusready");
}
// 拍照
function captureImage(){
	var cmr = plus.camera.getCamera();
	var res = cmr.supportedImageResolutions[0];
	var fmt = cmr.supportedImageFormats[0];
	console.log("Resolution: "+res+", Format: "+fmt);
	cmr.captureImage( function( path ){
			//alert( "Capture image success: " + path );  
		},
		function( error ) {
			//alert( "Capture image failed: " + error.message );
		},
		{resolution:res,format:fmt}
	);
}
	</script>
	</head>
		<body>
			<style type="text/css">
			 form{
			    width:100px;
			    margin-left:80px;
			    margin-top:80px;
			    padding:30px;
			 }
			</style>
	<form method="post">
	<label>username:<input type="text" name="name"></label>
	<br/><br/>
	<label>password:<input type="password" name="pw"></label>
	<br/><br/>
	<button type="submit" name="submit"><a href="../Main.html"style="text-decoration: none;color: #000000;">登录</a></button>
	<button onclick="captureImage()">二维码登录</button>
	</form>
		
	</body>
	<script>
		    document.addEventListener("plusready", function() {
		        // 注册返回按键事件
		        plus.key.addEventListener('backbutton', function() {
		            // 事件处理
		            window.history.back();
		        }, false);
		    });
		</script>
</html>